# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=xandikos
pkgver=0.2.8
pkgrel=1
pkgdesc="a lightweight yet complete CardDAV/CalDAV server that backs onto a Git repository"
url="https://xandikos.org"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	py3-aiohttp
	py3-defusedxml
	py3-dulwich
	py3-icalendar
	py3-jinja2
	py3-multidict
	py3-vobject
	python3
	"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/jelmer/xandikos/archive/v$pkgver.tar.gz
	xandikos.initd
	xandikos.confd
	"

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="." pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -m644 -D man/$pkgname.8 \
		"$pkgdir"/usr/share/man/man8/$pkgname

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="
da1b76b79b27e63cbf5416ef215dbd97c8a968e7db8c084b451e432feea7db2d93b673f17e66d1518cbd1b5586368226d393e6cd12a28f5917d53d734a8d0cfd  xandikos-0.2.8.tar.gz
8d49ef3ce004a666d4e9b1e97114d5bf381aa75538518ce7b15202bacf73ef90cd3ad751d6aae73b2b5768b37f58045ed3f34db0d004a8c5f479c1a79cbbcd60  xandikos.initd
8e1ef71e22809c9c7424dd518949e936d09d1da7f2911862d7943b71976554d74f72f186ea76bf8510b8fd95a75028fe369e5907c20695211425cf50c911388a  xandikos.confd
"
